import caffe
import numpy as np

np.set_printoptions(suppress=True)

net = caffe.Net('conv5x5.prototxt', 'conv5x5.caffemodel', caffe.TEST)
# net = caffe.Net('mace_test.prototxt', 'mace_test.caffemodel', caffe.TEST)

# weights
print 'weights', net.params['conv1'][0].data

count = 0
for x in np.nditer(net.params['conv1'][0].data):  
    print str(x)+',',
    count += 1
    if count % 5 == 0:
    	print 



# bias
print 'bias', net.params['conv1'][1].data



net.blobs['data'].data[...] = np.ones((1, 3, 28, 28))

out = net.forward()

print 'out', out['conv1'].shape
print out['conv1']


# # weights
# print 'weights', net.params['conv1'][0].data.reshape(1*3*5*5)